package pat;

import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class B1020 {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int nums = input.nextInt();
        int target = input.nextInt();
        float income = 0;

        float[][] data = new float[nums][2];

        for (int i = 0; i < nums; i++) {
            data[i][0] = input.nextInt();
        }
        for (int i = 0; i < nums; i++) {
            data[i][1] = input.nextInt();
        }

//        Arrays.sort(data, ((e1, e2) -> (int) (((float) (e2[1]) / e2[0]) - ((float) (e1[1]) / e1[0])) * 10));
        Arrays.sort(data, new Comparator<float[]>() {    // 匿名内部类
            public int compare(float[] e1, float[] e2) {
                return (int) ((((float) (e2[1]) / e2[0]) - ((float) (e1[1]) / e1[0])) * 10);
            }
        });

//        for (int i = 0; i < nums; i++) {
//            System.out.println(data[i][0] + " " + data[i][1] + " " + ((float) data[i][1] / data[i][0]));
//        }

        for (float[] cake : data) {
            if (target > cake[0]) {
                income += cake[1];
                target -= cake[0];
            } else if (target == cake[0]) {
                income += cake[1];
                target = 0;
                break;
            } else {
                income += ((float) cake[1] / cake[0]) * target;
                target = 0;
                break;
            }
        }
        System.out.println(String.format("%.2f", income));
    }
}
